package com.companion.companion.service.impl;

import java.util.List;

import com.companion.companion.domain.Carerecord;
import com.companion.companion.mapper.CarerecordMapper;
import com.companion.companion.service.ICarerecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 护工陪护记录Service业务层处理
 * 
 * @author zly
 * @date 2025-05-06
 */
@Service
public class CarerecordServiceImpl implements ICarerecordService
{
    @Autowired
    private CarerecordMapper carerecordMapper;

    /**
     * 查询护工陪护记录
     * 
     * @param careRecordId 护工陪护记录主键
     * @return 护工陪护记录
     */
    @Override
    public Carerecord selectCarerecordByCareRecordId(Long careRecordId)
    {
        return carerecordMapper.selectCarerecordByCareRecordId(careRecordId);
    }

    /**
     * 查询护工陪护记录列表
     * 
     * @param carerecord 护工陪护记录
     * @return 护工陪护记录
     */
    @Override
    public List<Carerecord> selectCarerecordList(Carerecord carerecord)
    {
        return carerecordMapper.selectCarerecordList(carerecord);
    }

    /**
     * 新增护工陪护记录
     * 
     * @param carerecord 护工陪护记录
     * @return 结果
     */
    @Override
    public int insertCarerecord(Carerecord carerecord)
    {
        return carerecordMapper.insertCarerecord(carerecord);
    }

    /**
     * 修改护工陪护记录
     * 
     * @param carerecord 护工陪护记录
     * @return 结果
     */
    @Override
    public int updateCarerecord(Carerecord carerecord)
    {
        return carerecordMapper.updateCarerecord(carerecord);
    }

    /**
     * 批量删除护工陪护记录
     * 
     * @param careRecordIds 需要删除的护工陪护记录主键
     * @return 结果
     */
    @Override
    public int deleteCarerecordByCareRecordIds(Long[] careRecordIds)
    {
        return carerecordMapper.deleteCarerecordByCareRecordIds(careRecordIds);
    }

    /**
     * 删除护工陪护记录信息
     * 
     * @param careRecordId 护工陪护记录主键
     * @return 结果
     */
    @Override
    public int deleteCarerecordByCareRecordId(Long careRecordId)
    {
        return carerecordMapper.deleteCarerecordByCareRecordId(careRecordId);
    }
}
